﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace DetailInfo
{
	[Serializable]
	public partial class DetailInfoModel : UIModel
	{
		#region Constructor
		public DetailInfoModel() : base("DetailInfo")
		{
			InitClass();
			this.SetResourceInfo("4d36a940-dc81-40fb-9adb-2d2ef0f2865f");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private DetailInfoModel(bool isInit) : base("DetailInfo")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new DetailInfoModel(false);
		}
		#endregion
		#region member
		#region views
		private DetailMainView viewDetailMain;			
		private DetailLineView viewDetailLine;			
		#endregion
		
		#region links
		//private IUILink linkDetailMain__DetailLine;			
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public DetailMainView DetailMain
		{
			get { return (DetailMainView)this["DetailMain"]; }
		}
		public DetailLineView DetailLine
		{
			get { return (DetailLineView)this["DetailLine"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewDetailMain = new DetailMainView(this);
			this.viewDetailMain.SetResourceInfo("4fcd048b-d8d3-4229-a420-3d445c22a14f");
			this.Views.Add(this.viewDetailMain);			
			this.viewDetailLine = new DetailLineView(this);
			this.viewDetailLine.SetResourceInfo("23aa2de8-c6ca-4735-ac15-4ad9a5bc4966");
			this.Views.Add(this.viewDetailLine);			

			//this.linkDetailMain__DetailLine
			{
			IUILink link = new UILink("DetailMain__DetailLine",this,this.viewDetailMain.FieldID,this.viewDetailLine.FieldDetailMain_ID,EnumAssociationKind.COMPOSITION,EnumAssociationDirection.Single,EnumCardinality.ONE,EnumCardinality.MORE,"");
			this.Links.Add(link);
			}
			//this.linkDetailMain__DetailLine.ChildKeyConstraint.UpdateRule = Rule.None;
			//this.linkDetailMain__DetailLine.ChildKeyConstraint.DeleteRule = Rule.None;
			//this.linkDetailMain__DetailLine.ChildKeyConstraint.AcceptRejectRule = AcceptRejectRule.None;
			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Learn.ItemUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class DetailMainView : UIView
	{
		#region Constructor
		public DetailMainView(IUIModel model) : base(model,"DetailMain","", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private DetailMainView():base(null,"DetailMain","", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new DetailMainView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldCreatedOn
		{
			get { return this.Fields["CreatedOn"]; }
		}
		public IUIField FieldCreatedBy
		{
			get { return this.Fields["CreatedBy"]; }
		}
		public IUIField FieldModifiedOn
		{
			get { return this.Fields["ModifiedOn"]; }
		}
		public IUIField FieldModifiedBy
		{
			get { return this.Fields["ModifiedBy"]; }
		}
		public IUIField FieldSysVersion
		{
			get { return this.Fields["SysVersion"]; }
		}
		public IUIField FieldCode
		{
			get { return this.Fields["Code"]; }
		}
		public IUIField FieldName
		{
			get { return this.Fields["Name"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public DetailMainDefaultFilterFilter DefaultFilter
		{
			get { return (DetailMainDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "", false,false, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","91778768-4e3b-44e4-8a7d-52741d63ed40");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedOn", typeof(DateTime), false,"","System.DateTime", "", false,false, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","c4ae5edf-f474-4ae5-8cba-0c424059037e");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedBy", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","98daca31-b22e-4a82-a472-d5dd2b328731");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedOn", typeof(DateTime), false,"","System.DateTime", "", false,false, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","bf2ddfda-acfc-4ce2-bb78-53d7e5eb43e7");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedBy", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","ec02cb4f-0a58-4969-a59b-5f6bc3ebb360");
			UIModelRuntimeFactory.AddNewUIField(this,"SysVersion", typeof(Int64), false,"","System.Int64", "", false,false, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","01fae1fc-f58c-476e-bd04-fad315e87584");
			UIModelRuntimeFactory.AddNewUIField(this,"Code", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","3bb53464-8db3-48e9-a5f4-701c339ff836");
			UIModelRuntimeFactory.AddNewUIField(this,"Name", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","49d0e66b-c399-42a2-ae14-1ec8b78d3d76");


			this.CurrentFilter = new DetailMainDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new DetailMainRecord(builder);
		}
		#endregion

		#region new method
		public new DetailMainRecord FocusedRecord
		{
			get { return (DetailMainRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new DetailMainRecord AddNewUIRecord()
		{	
			return (DetailMainRecord)base.AddNewUIRecord();
		}
		public new DetailMainRecord NewUIRecord()
		{	
			return (DetailMainRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class DetailMainRecord : UIRecord
	{
		#region Constructor
		public DetailMainRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private DetailMainView uiviewDetailMain
		{
			get { return (DetailMainView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new DetailMainRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewDetailMain.FieldID);
			}
			set{
				this[this.uiviewDetailMain.FieldID] = value;
			}
		}
		
		
		public  DateTime CreatedOn
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldCreatedOn] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewDetailMain.FieldCreatedOn);
			}
			set{
				this[this.uiviewDetailMain.FieldCreatedOn] = value;
			}
		}
		
		
		public  String CreatedBy
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldCreatedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailMain.FieldCreatedBy);
			}
			set{
				this[this.uiviewDetailMain.FieldCreatedBy] = value;
			}
		}
		
		
		public  DateTime ModifiedOn
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldModifiedOn] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewDetailMain.FieldModifiedOn);
			}
			set{
				this[this.uiviewDetailMain.FieldModifiedOn] = value;
			}
		}
		
		
		public  String ModifiedBy
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldModifiedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailMain.FieldModifiedBy);
			}
			set{
				this[this.uiviewDetailMain.FieldModifiedBy] = value;
			}
		}
		
		
		public new Int64 SysVersion
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldSysVersion] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewDetailMain.FieldSysVersion);
			}
			set{
				this[this.uiviewDetailMain.FieldSysVersion] = value;
			}
		}
		
		
		public  String Code
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailMain.FieldCode);
			}
			set{
				this[this.uiviewDetailMain.FieldCode] = value;
			}
		}
		
		
		public new String Name
		{
			get{
				//object value = this[this.uiviewDetailMain.FieldName] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailMain.FieldName);
			}
			set{
				this[this.uiviewDetailMain.FieldName] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class DetailMainDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public DetailMainDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private DetailMainDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new DetailMainDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



	[Serializable]
	public partial class DetailLineView : UIView
	{
		#region Constructor
		public DetailLineView(IUIModel model) : base(model,"DetailLine","", false)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private DetailLineView():base(null,"DetailLine","", false)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new DetailLineView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldDetailMain_ID
		{
			get { return this.Fields["DetailMain_ID"]; }
		}
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldCreatedOn
		{
			get { return this.Fields["CreatedOn"]; }
		}
		public IUIField FieldCreatedBy
		{
			get { return this.Fields["CreatedBy"]; }
		}
		public IUIField FieldModifiedOn
		{
			get { return this.Fields["ModifiedOn"]; }
		}
		public IUIField FieldModifiedBy
		{
			get { return this.Fields["ModifiedBy"]; }
		}
		public IUIField FieldSysVersion
		{
			get { return this.Fields["SysVersion"]; }
		}
		public IUIField FieldCode
		{
			get { return this.Fields["Code"]; }
		}
		public IUIField FieldName
		{
			get { return this.Fields["Name"]; }
		}
		public IUIField FieldQty
		{
			get { return this.Fields["Qty"]; }
		}
		public IUIField FieldMemo
		{
			get { return this.Fields["Memo"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public DetailLineDefaultFilterFilter DefaultFilter
		{
			get { return (DetailLineDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"DetailMain_ID", typeof(Int64), false,"","System.Int64", "", false,false, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","ac702b9f-52cf-48d2-b869-86d1fa2a4a13");
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "", false,false, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","91efeaeb-3b2e-4e85-92bf-15218b07b83c");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedOn", typeof(DateTime), false,"","System.DateTime", "", false,false, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","eb082fbd-3222-46d9-bc6c-d67f57168d53");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedBy", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","bc145c47-f86e-48e0-9938-f54920eb5a7c");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedOn", typeof(DateTime), false,"","System.DateTime", "", false,false, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","af335172-91bf-47aa-b70d-92e2b4684d38");
			UIModelRuntimeFactory.AddNewUIField(this,"ModifiedBy", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","2c3b926a-b65a-4061-80c4-9c7a9519d572");
			UIModelRuntimeFactory.AddNewUIField(this,"SysVersion", typeof(Int64), false,"","System.Int64", "", false,false, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","7dd0c96f-5552-4769-821e-ce324f04e1ee");
			UIModelRuntimeFactory.AddNewUIField(this,"Code", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","2306c1e7-83c2-42e9-b8d0-0cfb7d9a6b1e");
			UIModelRuntimeFactory.AddNewUIField(this,"Name", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","d79e7097-1a64-4f3c-b2cd-2568d071de49");
			UIModelRuntimeFactory.AddNewUIField(this,"Qty", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c327e68d-9472-4119-9f5f-eb897a91313b");
			UIModelRuntimeFactory.AddNewUIField(this,"Memo", typeof(String), false,"","System.String", "", false,false, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","07589851-b8aa-4734-94f2-3d6143a040bf");


			this.CurrentFilter = new DetailLineDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new DetailLineRecord(builder);
		}
		#endregion

		#region new method
		public new DetailLineRecord FocusedRecord
		{
			get { return (DetailLineRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new DetailLineRecord AddNewUIRecord()
		{	
			return (DetailLineRecord)base.AddNewUIRecord();
		}
		public new DetailLineRecord NewUIRecord()
		{	
			return (DetailLineRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class DetailLineRecord : UIRecord
	{
		#region Constructor
		public DetailLineRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private DetailLineView uiviewDetailLine
		{
			get { return (DetailLineView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new DetailLineRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 DetailMain_ID
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldDetailMain_ID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewDetailLine.FieldDetailMain_ID);
			}
			set{
				this[this.uiviewDetailLine.FieldDetailMain_ID] = value;
			}
		}
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewDetailLine.FieldID);
			}
			set{
				this[this.uiviewDetailLine.FieldID] = value;
			}
		}
		
		
		public  DateTime CreatedOn
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldCreatedOn] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewDetailLine.FieldCreatedOn);
			}
			set{
				this[this.uiviewDetailLine.FieldCreatedOn] = value;
			}
		}
		
		
		public  String CreatedBy
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldCreatedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldCreatedBy);
			}
			set{
				this[this.uiviewDetailLine.FieldCreatedBy] = value;
			}
		}
		
		
		public  DateTime ModifiedOn
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldModifiedOn] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewDetailLine.FieldModifiedOn);
			}
			set{
				this[this.uiviewDetailLine.FieldModifiedOn] = value;
			}
		}
		
		
		public  String ModifiedBy
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldModifiedBy] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldModifiedBy);
			}
			set{
				this[this.uiviewDetailLine.FieldModifiedBy] = value;
			}
		}
		
		
		public new Int64 SysVersion
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldSysVersion] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewDetailLine.FieldSysVersion);
			}
			set{
				this[this.uiviewDetailLine.FieldSysVersion] = value;
			}
		}
		
		
		public  String Code
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldCode);
			}
			set{
				this[this.uiviewDetailLine.FieldCode] = value;
			}
		}
		
		
		public new String Name
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldName] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldName);
			}
			set{
				this[this.uiviewDetailLine.FieldName] = value;
			}
		}
		
		
		public  String Qty
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldQty] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldQty);
			}
			set{
				this[this.uiviewDetailLine.FieldQty] = value;
			}
		}
		
		
		public  String Memo
		{
			get{
				//object value = this[this.uiviewDetailLine.FieldMemo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewDetailLine.FieldMemo);
			}
			set{
				this[this.uiviewDetailLine.FieldMemo] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class DetailLineDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public DetailLineDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private DetailLineDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new DetailLineDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}